1. Field of the Invention
The present invention relates to an electrographic copying machine where an image on an original glass stand projected by a film projector is read out by a scanner and copied, and more particularly, to a digital color electrographic copying machine.
2. Description of the Prior Art
Conventionally, such a film projector is set on a digital color electrographic copying machine as shown in FIG. 10. Reference numeral 1 represents a projector body incorporating a lamp (not shown) serving as a light source, a projector lens 2 and a loading portion 3 in which positive or negative film (mounted or stripped film) is loaded. Reference numeral 4 represents a mirror unit including a reflecting mirror 5 and a Fresnel lens (dispersing plate) 6. Light from the lamp is irradiated onto the film. Light transmitted by the film is directed to an original glass stand (contact glass) 7 of the copying machine by way of the projector lens 2, the reflecting mirror 5 and the Fresnel lens 6 to thereby project the image on the film onto the original glass stand 7.
To project an in-focus image on the original glass stand 7, it is necessary to adjust the position of the projector lens 2. Conventionally, whether an in-focus image is projected or not is determined by reading out an image on the original glass stand 7 by a color scanner 8 of the copying machine, and by a control signal based on a result of the determination, the position of the projector lens 2 is automatically adjusted (what is called, automatic focusing). To adjust the position of the projector lens 2, a stepping motor 9 of the projector body 1 is driven as shown in FIG. 11 by a control signal from the copying machine to move a cylinder 13 for holding the projector lens 2 backward and forward by variable speed gears 10, 11 and 12 and a teeth portion 13A.
Specifically, the projector lens 2 is moved by the stepping motor 9 from a home position (the forefront) to the rearmost end by a predetermined step while a charge coupled device (CCD) of R, G, B line structure of the color scanner 8 is located in the vicinity of the center of the projection area (image). During the movement of the projector lens 2, image data are read out by the CCD at each step position. In this case, 8-bit green image data (256 tones) of approximately 4800 pixels are read out for one line. Then, difference values of image data are obtained for 4800 pairs of adjoining pixels. The projector lens 2 is moved and fixed to a step position where the total of the difference values is maximum.
For example, when the projected image is a letter "A", if the image is in focus as shown in FIG. 12, the image (tone) data sampled (read out) by the CCD in the main scanning direction at an A-A' position is as shown in FIG. 13. If the image is out of focus as shown in FIG. 14, the outline (density) of the image is not sharp and, for example, black looks like grey, so that the image (tone) data sampled by the CCD in the main scanning direction at the A-A' position is gentle as shown in FIG. 15. For this reason, when the total of the difference values between adjoining pixels at the A-A' position at the lens positions (the projector lens 2 is moved from the forefront to the rearmost end) is obtained, as shown in FIG. 16, the total of the difference values is maximum at a lens position "1" where the image is in focus and the total of the difference values is considerably small at a lens position "2" where the image is out of focus.
Conventionally, in obtaining the total of the difference values, the difference values are obtained by obtaining the difference among image data for every adjoining pixels and squaring the difference (so that the difference may not take a negative value), for example, as shown in FIG. 1, (100 tones-104 tone).sup.2 =(-4).sup.2, and the total of the difference values for one line is obtained. Therefore, the result of the calculation is an extremely high value when the total of the difference values for many pixels is obtained. As a result, the calculation takes a long time. If the number of pixels used as samples is reduced, the calculation amount and processing time are reduced; however, the exact in-focus position of the lens cannot be detected.
Moreover, since the difference between image data is obtained for every adjoining pixels, when the image data of a pixel with which a noise component is mixed increases extremely, the effect of the noise component is directly reflected in the difference value. For example, when a number of high-value noise components are mixed at a lens position "3", a false peak of the total of the difference values is created by the noise components as shown in FIG. 2, so that the projector lens 2 may mistakenly be set at the lens position "3".
Further, since the position of the sampling by the CCD for automatic focusing is fixed to the vicinity of the center of the projected image, when the image at the sampling position is, for example, an image at a B-B' position as shown in FIGS. 12 and 14, the image data for one line lacks variation as shown in FIGS. 17 and 18, and the total of the difference values of adjoining pixels at the B-B' position at the lens positions is gentle and of low value as a whole as shown in FIG. 19. For this reason, the total of difference values at the lens position "1" where an in-focus image as shown in FIG. 12 is obtained is small and may be below a threshold value necessary for the lens position to be determined to be the in-focus lens position. In that case, the automatic focusing processing cannot be performed.